package top.ochiamalu.aioj.util;

/**
 * 代码工具类
 *
 * @author ochiamalu
 * @date 2025/04/09
 */
public class CodeUtils {

    /**
     * 生成随机代码
     *
     * @param length 长度
     * @return {@link String }
     */
    public static String generate(int length) {
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < length; i++) {
            int random = (int) (Math.random() * 10);
            sb.append(random);
        }
        return sb.toString();
    }
}
